var grid;
function initGrid(){
	grid = $("#maingrid").ligerGrid({
		url:HTR.U('index/sales/pageQuery'),
		pageSize:HTR.pageSize,
		pageSizeOptions:HTR.pageSizeOptions,
		height:'99%',
        width:'100%',
        minColToggle:6,
        rownumbers:true,
        columns: [
	        { display: '日期', name: 'createTime',isSort: false,width:150},
	        { display: '销售数量', name: 'saleSum',isSort: false,width:150},
	        { display: '产品名称', name: 'goodsName',align:'left',isSort: false},
	        { display: '操作', name: 'op',isSort: false,width:150,render: function (rowdata, rowindex, value){
	           return "<a href='"+HTR.U('index/sales/info','goodsId='+rowdata['goodsId']+'&createTime='+rowdata['createTime'])+"'>详情</a>";
	        }}
        ]
    });
}
function loadGrid(){
	var params = HTR.getParams('.j-ipt');
	grid.set('url',HTR.U('index/sales/pageQuery',params));
}
function initGrid2(){
	grid = $("#maingrid").ligerGrid({
		url:HTR.U('index/sales/pageQuery2'),
		pageSize:HTR.pageSize,
		pageSizeOptions:HTR.pageSizeOptions,
		height:'99%',
        width:'100%',
        minColToggle:6,
        rownumbers:true,
        columns: [
	        { display: '门店', name: 'shopName',isSort: false,width:150},
	        { display: '商品编号', name: 'goodsSn',isSort: false,width:150},
	        { display: '商品名称', name: 'goodsName',align:'left',isSort: false},
	        { display: '销售数量', name: 'saleNum',isSort: false,width:150},
	        { display: '店铺销售额', name: 'total',isSort: false,width:150}
        ]
    });
}
function loadGrid2(){
	var params = HTR.getParams('.j-ipt');
	grid.set('url',HTR.U('index/sales/pageQuery2',params));
}